<div class="sliderkit social-network__tabs">
	<div class="sliderkit-nav">
		<div class="sliderkit-nav-clip">
			<ul>
				<li class="social-network__tabs__in-contact">
					<span>Вконтакте</span>
				</li>
				<li class="social-network__tabs__facebook">
					<span>Facebook</span>
				</li>
				<li>
					<span id="qa-count">Вопросы на сайте ()</span>
				</li>
			</ul>
		</div>
	</div>
	<div class="sliderkit-panels">
		<div class="sliderkit-panel">
			<h2 class="b-small-title">&nbsp;Оставьте комментарий через Vkontakte</h2><br />
			<div id="vk_comments"></div>
		</div>
		<div class="sliderkit-panel">
			<div id="fb-root"></div>
			<h2 class="b-small-title">&nbsp;Оставьте комментарий через Facebook</h2><br />
			<div class="fb-comments" data-href="http://mobi03.ru/<?php echo Controller::$pageData['pageUrl'] ?>" data-width="924" data-num-posts="10"></div>
		</div>
		<div class="sliderkit-panel">
			<div class="global-form">
				<h3>Задать вопрос специалисту:</h3>
				<?php
				$form = $this->beginWidget('CActiveForm', array(
					'id' => 'review-form-main',
					'enableClientValidation' => true,
					'clientOptions' => array(
						'validateOnSubmit' => true,
					),
				));
				?>
				<div style="display: none">
					<?php echo $form->error($model, 'faqModelId'); ?>
					<?php echo $form->error($model, 'faqBrandId'); ?>
					<?php echo $form->error($model, 'faqCategoryId'); ?>
					<?php echo $form->error($model, 'faqTitle'); ?>
					<?php echo $form->error($model, 'faqContent'); ?>
					<?php echo $form->error($model, 'faqUserName'); ?>
					<?php echo $form->error($model, 'faqUserEmail'); ?>
					<?php echo $form->error($model, 'verifyCode'); ?>
				</div>
				<?php echo $form->hiddenField($model, 'faqCategoryId', array('value' => Controller::$pageData['_parents']['category']['pageId'])); ?>
				<?php echo $form->hiddenField($model, 'faqBrandId', array('value' => Controller::$pageData['_parents']['brand']['pageId'])); ?>
				<?php echo $form->hiddenField($model, 'faqModelId', array('value' => Controller::$pageData['pageId'])); ?>
				<fieldset>
					<ul class="global-form__list">
						<li>
							<div class="wrap-bg">
								<div class="type-text">
									<?php echo $form->textField($model, 'faqUserName', array('placeholder' => 'Ваше имя')); ?>										
								</div>
							</div> 
						</li>
						<li>      
							<div class="wrap-bg">
								<div class="type-text">
									<?php echo $form->textField($model, 'faqUserEmail', array('placeholder' => 'Ваш E-mail')); ?>									
								</div>
							</div> 
						</li>    
					</ul>        
				</fieldset>
				<fieldset>
					<div class="wrap-bg">
						<div class="textarea">
							<?php echo $form->textArea($model, 'faqContent', array('placeholder' => 'Ваш вопрос', 'cols' => 45, 'rows' => 10)); ?>							
						</div>
					</div> 
				</fieldset>
<!--				<fieldset>
					<div class="registration-form__right">
						<div class="registration-form__right__inner">
							<ul>
								<?php //if (CCaptcha::checkRequirements()): ?>
									<li>
										<div class="captcha">
											<?php //$this->widget('CCaptcha', array('buttonLabel' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;')); ?>
										</div>
									</li>
									<li>
										<div class="type-text">
											<?php //echo $form->textField($model, 'verifyCode', array('placeholder' => 'Введите пароль с картинки')); ?>									
										</div>
									</li>
								<?php //endif; ?>								
							</ul>
						</div>	
					</div>
				</fieldset>-->
				<fieldset>
					<div class="type-submit-wrap">
						<div class="type-submit-wrap__inner">
							<div class="type-submit">
								<?php echo CHtml::submitButton('Отправить'); ?>									
							</div>
						</div>    
					</div>  
				</fieldset>
				<?php $this->endWidget(); ?>
			</div>
			<?php if (!empty($faqs)): ?>
				<h3 class="middle-title">Вопросы и ответы по ремонту:</h3>
				<ul class="info-list">
					<?php
					foreach ($faqs as $faq):
						if (!isset($oldFaq) || $oldFaq['qId'] != $faq['qId']):
							?>
							<li>
								<span class="info-list__date"><?php echo date('d.m.Y', $faq['faqCreateDate']); ?></span>
								<h3>Вопрос задал(а): <?php echo $faq['qUser']; ?></h3>
								<p>
									<?php echo $faq['question']; ?>
								</p>
							<?php endif; ?>
							<div class="info-list__answer">
								<h3><?php echo $faq['aUser']; ?></h3>
								<p>
									<?php echo $faq['answer']; ?>
								</p>
							</div>    
						</li>
						<?php
						$oldFaq = $faq;
					endforeach;
					?>
				</ul>
			<?php endif; ?>
		</div>
	</div>
</div>
<style>
	#yw0_button {		
		background: url("/themes/front/assets/images/recaptcha.png") no-repeat scroll 3px center rgba(0, 0, 0, 0);
		text-decoration: none;		
		
	}
</style>
<script>
	$(document).ready(function() {
		var cnt = $('.info-list li').size();
		$('#qa-count').text('Вопросы на сайте (' + cnt + ')');
	});
</script>